package com.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dao.SqlMapper;
import com.dao.SysUserMapper;
import com.entity.SysUser;
import com.service.ISysUserService;

/**
 * @项目名称：dream-face
 * @类名称：SysUserServiceImpl
 * @类描述：
 * @创建人：YangChao
 * @联系方式：18629233301@163.com
 * @创建时间：2017年2月27日 下午2:37:04
 * @version 1.0.0
 */
@Service("sysUserService")
public class SysUserServiceImpl implements ISysUserService {

	@Autowired
	private SysUserMapper sysUserDao;
	@Autowired
	private SqlMapper sqlDao;
	
	@Override
	public SysUser findByUserName(String username) throws Exception {
		return sqlDao.getUser(username);
	}

	@Override
	public void saveOrUpdate(SysUser t) throws Exception {
		// TODO Auto-generated method stub

	}

	@Override
	public void removeById(Integer id) throws Exception {
		sysUserDao.deleteByPrimaryKey(id);

	}

	@Override
	public SysUser findById(Integer id) throws Exception {
		return sysUserDao.selectByPrimaryKey(id);
	}

	@Override
	public List<SysUser> find(SysUser t) throws Exception {
		return sysUserDao.getList(t);
	}

	@Override
	public int getCount(SysUser t) throws Exception {
		return sysUserDao.getCountSelective(t);
	}
}
